package com.dkm.biz.gl.util;

import java.util.List;

import net.sf.json.JSONArray;
import net.sf.json.JSONSerializer;
import net.sf.json.JsonConfig;

import org.apache.commons.lang.StringUtils;

import com.dkm.biz.gl.persistence.entity.AttrRangPo;

public class AttrRangeUtil {
	/**
	 * solr getRangeJson
	 * @param attrRangPo
	 * @return
	 */
	@SuppressWarnings("unchecked")
	public static List<AttrRangPo> getRangeJson(String attrRangPo)
	{
		if(StringUtils.isBlank(attrRangPo)){
			return null;
		}
		
		JsonConfig jsonConfig = new JsonConfig();
		jsonConfig.setRootClass(AttrRangPo.class);
		JSONArray jsonArray = JSONArray.fromObject(attrRangPo);
		List<AttrRangPo> vs = (List<AttrRangPo>) JSONSerializer.toJava(jsonArray, jsonConfig);
		return vs;
	}
}
